package com.mingtu.guards.view.popupview;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BottomPopupView;
import com.mingtu.common.utils.IntentUtils;
import com.mingtu.guards.R;
import com.mingtu.guards.activity.ChargeAreaMapActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * @ClassName :
 * @Author : wkk
 * @Date : 2023-10-18 16:36:04
 * @Email : 1281573890@qq.com
 * @Eescription :
 */
public class BottomPopupOther extends BottomPopupView {

    @BindView(R.id.layout_other1)
    LinearLayout layoutOther1;
    @BindView(R.id.layout_other2)
    LinearLayout layoutOther2;
    @BindView(R.id.layout_other3)
    LinearLayout layoutOther3;
    @BindView(R.id.layout_other4)
    LinearLayout layoutOther4;
    @BindView(R.id.layout_other5)
    LinearLayout layoutOther5;
    @BindView(R.id.layout_other6)
    LinearLayout layoutOther6;
    private OnStatusListener onStatusListener = null;
    private Unbinder unbinder;

    public BottomPopupOther(@NonNull Context context) {
        super(context);

    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.layout_bottom_popup_map_other;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        unbinder = ButterKnife.bind(this);

    }

    @Override
    protected void onShow() {
        super.onShow();
    }

    @Override
    protected void onDismiss() {
        if (onStatusListener != null)
            onStatusListener.onDismiss();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }

    @OnClick({R.id.layout_other1, R.id.layout_other2, R.id.layout_other3, R.id.layout_other4, R.id.layout_other5, R.id.layout_other6})
    public void onViewClicked(View view) {
        dismiss();
        switch (view.getId()) {
            case R.id.layout_other1:
                //网格
                IntentUtils.getInstance().readyGo(getActivity(), ChargeAreaMapActivity.class);
                break;
            case R.id.layout_other2:
                //动物
                break;
            case R.id.layout_other3:
                //植物
                break;
            case R.id.layout_other4:
                //上报事件
                break;
            case R.id.layout_other5:
                //红外拍摄
                break;
            case R.id.layout_other6:
                //巡护热力图
                break;
        }
    }

    public void setOnStatusListener(OnStatusListener onStatusListener) {
        this.onStatusListener = onStatusListener;
    }


    public static interface OnStatusListener {
        void onDismiss();

        void onShow();
    }
}
